package com.iflytek.uc.service;

import java.util.List;

import com.iflytek.uc.domain.EntityType;
import com.iflytek.uc.domain.Relation;
import com.iflytek.uc.domain.EntityType.EntityCategory;
import com.iflytek.uc.exceptions.DuplicateKeyException;

public interface EntityTypeService {
	
	List<EntityType> getEntityTypes();
	
	EntityType getEntityTypeByName(String name);

	List<EntityType> getRootEntityTypes();
	
	List<EntityType> getRootEntityTypes(EntityCategory category);
	
	EntityType createEntityType(String name, 
			EntityCategory category, 
			String displayName, 
			int displayOrder, 
			String icon16) throws DuplicateKeyException;
	
	void updateEntityType(String name, 
			EntityCategory category, 
			String displayName, 
			int displayOrder, 
			String icon16) throws DuplicateKeyException;
	
	void deleteEntityType(String name);
	
	List<Relation> getParentRelations(String name);
	
	List<Relation> getChildRelations(String name);
}
